{imp:"uio/_laypc"}<!--模板继承-->

{block:minit}{:parent}{code:"_config/user_apply"}{/block:minit}

{block:action}

{if $user->userFlag=='Login' }
    <div class="text-danger bg-warning pa10">
      <p class="text-danger bg-warning right w350 pa10" style="margin:-10px -10px 0px 0px">
        [{=$user->usess['uname']}] {lang(user.lon_logined)}
      </p>
      <p> {lang(user.lon_change)}【<a href="?uio-logout">{lang(user.lon_logout)}</a>】; </p>
      <p> {lang(user.lon_touto)}：{php echo date('Y-m-d H:i:s',$user->usess['stime']+$user->utmOut); } </p>
    </div>
{elseif !empty($bsend) }
    <div class="text-danger bg-warning pa10">
      <p class="text-danger bg-warning right w350 pa10 tc" style="margin:-10px -10px 0px 0px">
        {=$show} <br>
        <a href="{surl(login)}">{lang(user.nv2_login)}</a> # <a href="{surl(reg)}">{lang(user.nv2_reg)}</a> # <a href="{surl(0)}">{lang(user.nv2_home)}</a>
      </p>
      <p> {=$msg} </p>
      {if $ucfg['regnow']=='mail-act'}
        {if !empty($msg_em) && strpos($msg_em,'SentOK')} 
          <p> {lang(user.uap_loginemail)}: {=$fm['memail']} {lang(user.uap_activeuser)} </p>
        {else}
          <p> {=$msg_em}</p>
        {/if}
      {/if}
    </div>
{else}
    <div class="text-danger bg-warning pa10 mv10">
      <p class="text-danger bg-warning right w350 pa10" style="margin:-10px -10px 0px 0px">
        <a href="{surl(login)}">{lang(user.nv2_login)}</a> # <a href="{surl(reg)}">{lang(user.nv2_reg)}</a> # <a href="{surl(0)}">{lang(user.nv2_home)}</a>
      </p>
      <p> {lang(user.uap_hasuid)}<a href="{surl(login)}">{lang(user.uap_login)}</a>！ </p>
    </div>
{/if}

{if !empty($fappok) }
    <div class="pgu_applay">
      <div class="h10">&nbsp;</div>
      <div class="apform">
        <p> <i>{lang(uname)}: </i>
            <input value="{=$re3['uname']}" style='width:320px'; />
        </p>
        <p> <i>{lang(upass)}: </i>
            <input value="{=$fm['upass']}" style='width:320px'; />
        </p>
        <p> <i>{lang(user.uap_check)}: </i>
            <input value="{=$show}" style='width:320px'; />
        </p>
        <p> <i>UID: </i>
            <input value="{=$re3['uid']}" style='width:320px'; />
        </p>
        <p class="h08">&nbsp;</p>
      </div>
      <div class="cleft"></div>
    </div>
{/if}
{if empty($bsend) }
    <style type="text/css">
    #fmapply .form-control { display:inline-block; }
    </style>
    {php eimp('/layer/layer.js','vendui'); }
    <form action="?reg" usercheck='uapply' method="post" name="fmapply" id="fmapply">
    <div class="pgu_applay">
      <div class="h10">&nbsp;</div>
      <div class="apform">
        <p> <i>{lang(user.uap_type)}: </i>
            {loop $_groups $k $v}{if $v['pid']=='users'}
            {php $cfgm = read($k); $cfgs = basElm::text2arr(@$cfgm['cfgs']); }
            {if !empty($cfgs['defgrade']) }
            <input name="mod" type="radio" value="{=$k}" onclick="setUserMod(this)" {if $k=='company'}checked{/if} />{=$v[title]} &nbsp; 
            {/if}{/if}{/loop}
        </p>
        <div class="h03">&nbsp;</div>
        <p> <i>{lang(uname)}: </i>
            <input id="fm[uname]" name="fm[uname]" tabindex="1" type="text" class="txt w140" reg="key:2-15" tip="{lang(admin.fad_uid31546)}" url='{=PATH_BASE}?ajax-cajax&act=userExists' style='width:150px'; />
        </p>
        <p> <i>{lang(upass)}: </i>
            <input id="fm[upass]" name="fm[upass]" tabindex="2" type="password" class="txt w140" reg="str:6-24" autocomplete="off" tip="{lang(admin.fad_up624)}" style='width:150px'; />
            <i>{lang(user.uap_pw2)}: </i>
            <input id="fm[upass2]" name="fm[upass2]" tabindex="2" type="password" class="txt w140" reg="str:6-24" autocomplete="off" tip="{lang(admin.fad_up624)}" style='width:150px'; />
        </p>
        <p id="pflg_company"> <i>{lang(user.uap_corp)}: </i>
            <input id='fm[company]' name='fm[company]' type='text' value='' class='txt'  maxlength='24'  reg='nul:str:2-24'  style='width:420px';  />
        </p>
        {if in_array($ucfg['regnow'],array('idpwd','mail-act')) }
        {if $ucfg['regnow']=='mail-act' }
        <style type="text/css">
        #fmapply .form-control { display:inline-block; }
        input::input-placeholder{text-align: right;}
        input::-ms-input-placeholder{text-align: right;}
        input::-webkit-input-placeholder{text-align: right;}
        </style>
        <?php 
        $emajax="url='".PATH_BASE."?ajax-cajax&act=userExists&key=memail'"; 
        $phem = "placeholder='".lang('user.uap_forgamail')."'";
        ?>
        {/if}
        <p> <i id="iflg_mname">{lang(user.uap_name)}: </i>
            <input id='fm[mname]' name='fm[mname]' type='text' value='' class='txt'  maxlength='24'  reg='str:2-24' style='width:150px';  />
            <i>{lang(user.uap_tel)}: </i>
            <input id='fm[mtel]' name='fm[mtel]' type='text' value='' class='txt'  maxlength='24'  reg='fix:tel'  style='width:150px'; />
        </p>
        <p> <i>{lang(user.uap_mail)}: </i>
            <input id='fm[memail]' name='fm[memail]' type='text' value='' class='txt'  maxlength='255' {=$emajax} reg='nul:fix:email'  tip='eg:peace@domain.com' style='width:420px'; {=$phem} />
        </p>
        <p> <i>{lang(vcode)}: </i>
            <script>fsInit('fmapply','5,-25','form-control w90');</script>
            <span class="submit">
            <input name="bsend" value="{lang(submit)}" tabindex="19830" type="submit" class="btn w120 btn-primary" />
            <input name="act" type="hidden" value="doapply" />
            <input name="recbk" type="hidden" value="{=$recbk}" />
            </span>
        </p>
        {elseif $ucfg['regnow']=='sms-vcode' }
        <p> <i id="iflg_mname">{lang(user.uap_name)}: </i>
            <input id='fm[mname]' name='fm[mname]' type='text' value='' class='txt'  maxlength='24'  reg='str:2-24' style='width:150px';  />
            <i>{lang(user.uap_mail)}: </i>
            <input id='fm[memail]' name='fm[memail]' type='text' value='' class='txt'  maxlength='255'  reg='nul:fix:email'  tip='eg:peace@domain.com'  style='width:150px';  />
        </p>
        <p> <i>{lang(user.uap_mobnum)}: </i>
            <input id='fm_mtel' onblur="chkMtel()" name='fm[mtel]' type='text' value='' class='txt'  maxlength='24' url='{=PATH_BASE}?ajax-cajax&act=userExists&key=mtel' reg='fix:tel' style='width:150px';  />
            <i>-</i>
            <i id='send2nd' class="vcm1" onclick="reSend()">{lang(user.uap_forgsmscode)}</i>
            <!--/请正确输入手机号/等待发送短信/(58秒)重新发送短信/图片 短信/-->
        </p>
        <p id='rowvc1' style="display:none;"> <i>{lang(vcode)}: </i>
            <script>fsInit('vsms4','5,-32','w60');</script>
            <i class="vcm2">{lang(user.uap_cshowvcode)}</i>
            <i id='sendsms' class="vcm1" onclick="sendSms()">{lang(user.uap_getvcode)}</i>
        </p>
        <p id='rowvc2'> <i class="vct1">{lang(user.uap_smsvcode)}: </i> 
            <input id='fm_smscode' name='fm[smscode]' type='text' value='' class='txt' maxlength='6'  reg='str:6-6' style='width:90px'; placeholder="{lang(user.uap_smsvcode)}"  />
            <i>- </i>
            <input name="bsend" value="{lang(submit)}" tabindex="19830" type="submit" class="btn w120 btn-primary" />
            <input name="act" type="hidden" value="doapply" />
            <input name="recbk" type="hidden" value="{=$recbk}" />
        </p>
        {/if}
        <p class="h08">&nbsp;</p>
      </div>
      <div class="cleft"></div>
    </div>
    </form> 
{/if} 

{php}eimp('/base/assets/jslib/jq_base.js');{/php}
<script>
function setUserMod(e){
    var v = $(e).val(); 
    if(v=='person'){
        $('#iflg_mname').html('{lang(user.uap_name)}');
        $('#pflg_company').hide();
    }else{
        $('#iflg_mname').html('{lang(user.uap_link)}');
        $('#pflg_company').show();        
    }
}
var evf_isExtends = true;
function evf_uapply(msgarr,isSubmit){ 
    //jsLog(msgarr); jsLog(isSubmit); //return false;
    if(msgarr.length>0){
        evf_errAlert(msgarr,isSubmit);
        return false;
    }
    var pw1 = $(jsElm.jeID('fm[upass]'));
    var pw2 = $(jsElm.jeID('fm[upass2]'));
    if( pw1.val() && $(pw1).val() == $(pw2).val() ){ //匹配成功
        $(pw2).evf_callback(null,"sucess");
    }else{//匹配失败
        $(pw2).evf_callback("{lang(user.uap_pwxeq)}","failed");
        return false;
    }
}
</script>

{/block:action}